import Vue from 'vue'
import VueRouter from 'vue-router'
// import getrouter from './modules/user'
import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      title: '首页',
      keepAlive: false, // 不需要缓存
    },
    children: [
     // 首页
      {
        path: '/homePage',
        name: 'homePage',
        component: require('../components/main/main.vue'),
        meta: {
          title: '首页',
          keepAlive: true,
        }
      },
      // 用户管理
      // {
      //   path: '/useMan',
      //   name: 'useMan',
      //   component: require('../components/aside/modules/user/index.vue'),
      //   children: [
      //     getrouter.use,
      //     getrouter.roles
      //   ]
      // },
      // 内容管理
      // {
      //   path: '/secMan',
      //   name: 'secMan',
      //   component: require('../components/aside/modules/typeof/index.vue'),
      //   children: [
      //     getrouter.typeof, getrouter.studentType, getrouter.userPage
      //   ]
      // },
      // 系统管理
      // {
      //   path: '/systeMa',
      //   name: 'systeMa',
      //   component: require('../components/aside/modules/run/index.vue'),
      //   children: [
      //     getrouter.run, getrouter.operationLo, getrouter.link
      //   ]
      // },
    ]
  },
  { path: '/login', name: 'login', component: () => import('@/views/login.vue') },
  // 命名不能用特殊字符
  { path: '/401', name: '401', component: () => import('@/views/errPage/401.vue') },
  // 404
  { path: '/404', name: '404', component: () => import('@/views/errPage/404.vue') }

]
const router = new VueRouter({
  routes
})

export default router
